<html>
<head><meta charset="utf-8"><title>MIR `Yield` terminators · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/MIR.20.60Yield.60.20terminators.html">MIR `Yield` terminators</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="165416766"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/MIR%20%60Yield%60%20terminators/near/165416766" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/MIR.20.60Yield.60.20terminators.html#165416766">(May 11 2019 at 15:36)</a>:</h4>
<p>Does anyone know how to get rustc to generate a MIR block which terminates with <a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc/mir/enum.TerminatorKind.html#variant.Yield" target="_blank" title="https://doc.rust-lang.org/nightly/nightly-rustc/rustc/mir/enum.TerminatorKind.html#variant.Yield"><code>TerminatorKind::Yield</code></a>?</p>



<a name="165416786"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/MIR%20%60Yield%60%20terminators/near/165416786" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/MIR.20.60Yield.60.20terminators.html#165416786">(May 11 2019 at 15:37)</a>:</h4>
<p>I thought perhaps something like this would do it <a href="https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=7855a59b2edfa5a99215603f2d9eb03e" target="_blank" title="https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=7855a59b2edfa5a99215603f2d9eb03e">https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=7855a59b2edfa5a99215603f2d9eb03e</a></p>



<a name="165416789"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/MIR%20%60Yield%60%20terminators/near/165416789" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/MIR.20.60Yield.60.20terminators.html#165416789">(May 11 2019 at 15:37)</a>:</h4>
<p>But there aren't any <code>Yield</code>s in the mir</p>



<a name="165417069"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/MIR%20%60Yield%60%20terminators/near/165417069" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zoxc <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/MIR.20.60Yield.60.20terminators.html#165417069">(May 11 2019 at 15:45)</a>:</h4>
<p>Yields are lowered before the MIR printing on the playground</p>



<a name="165417072"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/MIR%20%60Yield%60%20terminators/near/165417072" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/MIR.20.60Yield.60.20terminators.html#165417072">(May 11 2019 at 15:45)</a>:</h4>
<p>Ah ok</p>



<a name="165417074"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/MIR%20%60Yield%60%20terminators/near/165417074" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/MIR.20.60Yield.60.20terminators.html#165417074">(May 11 2019 at 15:45)</a>:</h4>
<p>Thanks!</p>



<a name="165417120"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/MIR%20%60Yield%60%20terminators/near/165417120" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zoxc <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/MIR.20.60Yield.60.20terminators.html#165417120">(May 11 2019 at 15:46)</a>:</h4>
<p>Use <code>rustc test.rs -Z dump-mir-dir=mir -Z dump-mir=</code> to dump intermediate MIR</p>



<a name="165417129"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/MIR%20%60Yield%60%20terminators/near/165417129" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/MIR.20.60Yield.60.20terminators.html#165417129">(May 11 2019 at 15:46)</a>:</h4>
<p>intermediate MIR =&gt; IMIR</p>



<a name="165417142"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/MIR%20%60Yield%60%20terminators/near/165417142" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/MIR.20.60Yield.60.20terminators.html#165417142">(May 11 2019 at 15:47)</a>:</h4>
<p>Rust's intermediate MIR =&gt; RIMIR</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>